home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / misc / emu / ATUtilities.lha / ATUtilities / FTasten.c < prev    next >
C/C++ Source or Header  |  2000-09-26  |  18KB  |  715 lines

  1. /* ******************************************************************* */
  2. /* **                                                               ** */
  3. /* **                     ATKeyboard Version 4.0                    ** */
  4. /* **           Copright (C) 1992-1994 by Thomas Dreibholz          ** */
  5. /* **                       All rights reserved                     ** */
  6. /* **                                                               ** */
  7. /* **                       F-Tasten-Verwaltung                     ** */
  8. /* **                                                               ** */
  9. /* ******************************************************************* */
  10.  
  11. #include "ATKeyboard.h"
  12.  
  13. EXTERN UBYTE                *HelpName;
  14. EXTERN LONG                  KickstartVersion;
  15. extern struct Einstellungen  Einstellungen;
  16. extern struct KeyCodes      *KeyCodes;
  17. extern struct FileRequester *FileRequester;
  18. extern struct IntuiText      Trennlinie_Text;
  19. extern struct IntuiText      Wirklich_Text;
  20. extern struct TextAttr       OpalFontDef;
  21.  
  22. VOID AddKGadget();
  23.  
  24. struct IntuiText FTHilfe_Text=
  25. {
  26.  AUTOFRONTPEN,AUTOBACKPEN,AUTODRAWMODE,AUTOLEFTEDGE,1,&OpalFontDef,
  27.  "Hilfe zum F-Tasten-Editor",
  28. };
  29.  
  30. struct IntuiText FK_Text=
  31. {
  32.  AUTOFRONTPEN,AUTOBACKPEN,AUTODRAWMODE,AUTOLEFTEDGE,1,&OpalFontDef,
  33.  "Kommentar ändern",
  34. };
  35.  
  36. struct IntuiText FU_Text=
  37. {
  38.  AUTOFRONTPEN,AUTOBACKPEN,AUTODRAWMODE,AUTOLEFTEDGE,1,&OpalFontDef,
  39.  "Rücknahme aller Aktionen",
  40. };
  41.  
  42. struct IntuiText FL_Text=
  43. {
  44.  AUTOFRONTPEN,AUTOBACKPEN,AUTODRAWMODE,AUTOLEFTEDGE,1,&OpalFontDef,
  45.  "FKey-Datei laden",
  46. };
  47.  
  48. struct IntuiText FS_Text=
  49. {
  50.  AUTOFRONTPEN,AUTOBACKPEN,AUTODRAWMODE,AUTOLEFTEDGE,1,&OpalFontDef,
  51.  "FKey-Datei sichern",
  52. };
  53.  
  54. struct IntuiText FE_Text=
  55. {
  56.  AUTOFRONTPEN,AUTOBACKPEN,AUTODRAWMODE,AUTOLEFTEDGE,1,&OpalFontDef,
  57.  "Übernehmen und Beenden",
  58. };
  59.  
  60.  
  61. struct MenuItem FE_Item=
  62. {
  63.  NULL,
  64.  5,30,300,10,
  65.  HIGHIMAGE|ITEMENABLED|ITEMTEXT|COMMSEQ,
  66.  0L,
  67.  &FE_Text,
  68.  &Wirklich_Text,
  69.  'Q',NULL
  70. };
  71.  
  72. struct MenuItem Trennlinie01_Item=
  73. {
  74.  &FE_Item,
  75.  5,20,300,10,
  76.  HIGHNONE|ITEMTEXT,
  77.  0L,
  78.  &Trennlinie_Text,
  79.  NULL,
  80.  0,NULL
  81. };
  82.  
  83. struct MenuItem FS_Item=
  84. {
  85.  &Trennlinie01_Item,
  86.  5,10,300,10,
  87.  HIGHCOMP|ITEMENABLED|ITEMTEXT|COMMSEQ,
  88.  0L,
  89.  &FS_Text,
  90.  NULL,
  91.  'S',NULL
  92. };
  93.  
  94. struct MenuItem FL_Item=
  95. {
  96.  &FS_Item,
  97.  5,0,300,10,
  98.  HIGHCOMP|ITEMENABLED|ITEMTEXT|COMMSEQ,
  99.  0L,
  100.  &FL_Text,
  101.  NULL,
  102.  'L',NULL
  103. };
  104.  
  105. struct MenuItem FK_Item=
  106. {
  107.  NULL,
  108.  5,10,300,10,
  109.  HIGHCOMP|ITEMENABLED|ITEMTEXT|COMMSEQ,
  110.  0L,
  111.  &FK_Text,
  112.  NULL,
  113.  'K',NULL
  114. };
  115.  
  116. struct MenuItem FU_Item=
  117. {
  118.  &FK_Item,
  119.  5,0,300,10,
  120.  HIGHCOMP|ITEMENABLED|ITEMTEXT|COMMSEQ,
  121.  0L,
  122.  &FU_Text,
  123.  NULL,
  124.  'X',NULL
  125. };
  126.  
  127. struct MenuItem FTHilfe_Item=
  128. {
  129.  NULL,
  130.  -235,0,300,10,
  131.  HIGHCOMP|ITEMENABLED|ITEMTEXT|COMMSEQ,
  132.  0L,
  133.  &FTHilfe_Text,
  134.  NULL,
  135.  'H',NULL
  136. };
  137.  
  138. struct Menu FTHilfe_Menu=
  139. {
  140.  NULL,
  141.  560,0,70,10,
  142.  MENUENABLED,
  143.  "Hilfe",
  144.  &FTHilfe_Item
  145. };
  146.  
  147. struct Menu Bearbeiten_Menu=
  148. {
  149.  &FTHilfe_Menu,
  150.  140,0,130,10,
  151.  MENUENABLED,
  152.  "Bearbeiten",
  153.  &FU_Item
  154. };
  155.  
  156. struct Menu Datei_Menu=
  157. {
  158.  &Bearbeiten_Menu,
  159.  5,0,130,10,
  160.  MENUENABLED,
  161.  "Datei",
  162.  &FL_Item
  163. };
  164.  
  165. #define MENU_DATEI 0
  166. #define ITEM_LADEN 0
  167. #define ITEM_SICHERN 1
  168. #define ITEM_ENDE 3
  169. #define MENU_BEARBEITEN 1
  170. #define ITEM_UNDO 0
  171. #define ITEM_KOMMENTAR 1
  172. #define MENU_HILFE 2
  173. #define ITEM_HILFE 0
  174.  
  175. UBYTE Kommentar[25];
  176. UBYTE Undo[25];
  177.  
  178. struct StringInfo SInfo=
  179. {
  180.  &Kommentar,
  181.  &Undo,
  182.  1,24
  183. };
  184.  
  185. struct Gadget Kommentar_Gadget=
  186. {
  187.  NULL,
  188.  230,51,198,10,
  189.  GADGHCOMP,
  190.  TOGGLESELECT|RELVERIFY,
  191.  STRGADGET,
  192.  NULL,NULL,NULL,
  193.  NULL,&SInfo,200,NULL
  194. };
  195.  
  196. struct Gadget Aufnahme_Gadget=
  197. {
  198.  NULL,
  199.  10,48,91,13,
  200.  GADGHCOMP,
  201.  TOGGLESELECT|GADGIMMEDIATE,
  202.  BOOLGADGET,
  203.  NULL,NULL,NULL,
  204.  NULL,NULL,102,NULL
  205. };
  206.  
  207. struct Gadget *Shift_Gadget;
  208. struct Gadget *Ctrl_Gadget;
  209.  
  210. UBYTE Nummer;
  211. UBYTE Shift,Ctrl;
  212.  
  213.  
  214. /* Codeposition ermitteln */
  215. UBYTE *GetCode()
  216. {
  217.  REGISTER UBYTE *code;
  218.  
  219.  code=&KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten.FTasten[Nummer-1];
  220.  if((Shift!=0)&&(Ctrl==0)) code=&KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten.FTastenShift[Nummer-1];
  221.  if((Shift==0)&&(Ctrl!=0)) code=&KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten.FTastenCtrl[Nummer-1];
  222.  if((Shift!=0)&&(Ctrl!=0)) code=&KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten.FTastenShiftCtrl[Nummer-1];
  223.  return(code);
  224. }
  225.  
  226.  
  227. /* Kommentarposition ermitteln */
  228. UBYTE *GetK()
  229. {
  230.  REGISTER UBYTE *k;
  231.  
  232.  k=&KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten.FTastenKommentar[Nummer-1];
  233.  if((Shift!=0)&&(Ctrl==0)) k=&KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten.FTastenShiftKommentar[Nummer-1];
  234.  if((Shift==0)&&(Ctrl!=0)) k=&KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten.FTastenCtrlKommentar[Nummer-1];
  235.  if((Shift!=0)&&(Ctrl!=0)) k=&KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten.FTastenShiftCtrlKommentar[Nummer-1];
  236.  return(k);
  237. }
  238.  
  239.  
  240. /* F-Tastenbelegungen zeigen */
  241. VOID ZeigeFTasten()
  242. {
  243.  UBYTE                         text[40];
  244.  UBYTE                        *code;
  245.  UBYTE                        *k;
  246.  REGISTER BOOL                 ende;
  247.  REGISTER ULONG                Class;
  248.  REGISTER WORD                 i,Code;
  249.  struct Gadget                *ZeigeShift_Gadget,*ZeigeCtrl_Gadget;
  250.  register struct Gadget       *gad;
  251.  register struct Window       *win;
  252.  register struct RastPort     *rp;
  253.  register struct IntuiMessage *msg;
  254.  
  255.  Shift=Ctrl=0;
  256.  win=CreateStdWindow("ATKeyboard - Funktionstastenbelegung zeigen",
  257.                      75,75,460,164+BorderHeight(),
  258.                      GADGETUP|GADGETDOWN|CLOSEWINDOW|VANILLAKEY,
  259.                      WINDOWDEPTH|WINDOWDRAG|WINDOWCLOSE|ACTIVATE|GIMMEZEROZERO);
  260.  if(win!=NULL)
  261.   {
  262.    rp=win->RPort;
  263.    SetFont(rp,GetOpalFont());
  264.    ZeigeShift_Gadget=CreateNToggleGadget(win,10,2,120,12,"Shift",100);
  265.    ZeigeCtrl_Gadget=CreateNToggleGadget(win,135,2,120,12,"Control",101);
  266.    CreateBoolGadget(win,320,2,120,12,"Hilfe",102);
  267.    DrawNBorder(win,10,28,430,129);
  268.    ende=FALSE;
  269.    while(ende==FALSE)
  270.     {
  271.      for(Nummer=1;Nummer<=10;Nummer++)
  272.       {
  273.        i=Nummer*12;
  274.        SetAPen(rp,0);
  275.        RectFill(rp,19,20+i,439,30+i);
  276.        SelectStdFPen(rp);
  277.        sprintf(&text,"F%ld:",Nummer);
  278.        WriteText(rp,20,28+i,&text);
  279.        code=GetCode();
  280.        k=GetK();
  281.        if(code[0]==0)
  282.         {
  283.          strcpy(&text,"(Tastenkombination ist nicht belegt)");
  284.         }
  285.        else if((code[0]!=0)&&(k[0]==0))
  286.         {
  287.          strcpy(&text,"(Belegt, aber keine Benennung - Benutzen Sie \"Kommentar ändern\")");
  288.         }
  289.        else
  290.         {
  291.          strcpy(&text,k);
  292.         }
  293.        WriteText(rp,70,28+(Nummer*12),&text);
  294.       }
  295.      WaitPort(win->UserPort);
  296.      msg=GetMsg(win->UserPort);
  297.      Class=msg->Class;
  298.      Code=msg->Code;
  299.      gad=msg->IAddress;
  300.      ReplyMsg(msg);
  301.      switch(Class)
  302.       {
  303.        case CLOSEWINDOW:
  304.          ende=TRUE;
  305.         break;
  306.        case GADGETUP:
  307.        case GADGETDOWN:
  308.          switch(gad->GadgetID)
  309.           {
  310.            case 100:
  311.              if(ZeigeShift_Gadget->Flags & SELECTED) Shift=1; else Shift=0;
  312.             break;
  313.            case 101:
  314.              if(ZeigeCtrl_Gadget->Flags & SELECTED) Ctrl=1; else Ctrl=0;
  315.             break;
  316.            case 102:
  317.              if(Class==GADGETUP) Help(HelpName,149);
  318.             break;
  319.           }
  320.         break;
  321.        case VANILLAKEY:
  322.          if(Code==13) ende=TRUE;
  323.         break;
  324.       }
  325.     }
  326.    DeleteStdWindow(win);
  327.   }
  328. }
  329.  
  330.  
  331. /* Tastencodes zeigen */
  332. VOID ZeigeCode(rp,bool)
  333.  struct RastPort *rp;
  334. {
  335.  REGISTER WORD  x,y,n,anz;
  336.  UBYTE         *code;
  337.  UBYTE          tx[6];
  338.  
  339.  if(bool==TRUE)
  340.   {
  341.    SetAPen(rp,0);
  342.    RectFill(rp,11,64,436,99);
  343.   }
  344.  SelectStdFPen(rp);
  345.  code=GetCode();
  346.  n=1; anz=code[0];
  347.  for(y=0;y<4;y++)
  348.   {
  349.    for(x=0;x<12;x++)
  350.     {
  351.      if(n<=anz)
  352.       {
  353.        sprintf(&tx,"$%02lx",code[n]);
  354.        WriteText(rp,18+(x*35),75+(y*12),&tx);
  355.       }
  356.      else
  357.       {
  358.        WriteText(rp,18+(x*35),75+(y*12)," ·");
  359.       }
  360.      n++;
  361.     }
  362.   }
  363. }
  364.  
  365.  
  366. VOID PrintK(win)
  367.  struct Window *win;
  368. {
  369.  
  370.  SetAPen(win->RPort,0);
  371.  RectFill(win->RPort,224,47,439,61);
  372.  DrawMNTextBorder(win,225,48,213,12,GetK());
  373. }
  374.  
  375.  
  376. /* Neue Belegung */
  377. VOID Aufnahme(win)
  378.  struct Window *win;
  379. {
  380.  UBYTE                        *code;
  381.  UBYTE                        *k;
  382.  REGISTER ULONG                Class;
  383.  REGISTER UWORD                Code;
  384.  REGISTER BOOL                 ende,ignore;
  385.  register struct IntuiMessage *msg;
  386.  register struct RastPort     *rp;
  387.  register struct Gadget       *gad;
  388.  REGISTER UBYTE                n;
  389.  
  390.  rp=win->RPort;
  391.  code=GetCode();
  392.  k=GetK();
  393.  strcpy(&Kommentar,k);
  394.  AddKGadget(win);
  395.  for(n=0;n<49;n++) code[n]=0x00;
  396.  ZeigeCode(rp,TRUE);
  397.  ende=FALSE;
  398.  ignore=FALSE;
  399.  n=1;
  400.  while(ende==FALSE)
  401.   {
  402.    WaitPort(win->UserPort);
  403.    msg=GetMsg(win->UserPort);
  404.    Class=msg->Class;
  405.    Code=msg->Code;
  406.    gad=msg->IAddress;
  407.    ReplyMsg(msg);
  408.    switch(Class)
  409.     {
  410.      case RAWKEY:
  411.        if(n<=48)
  412.         {
  413.          if(!((ignore==TRUE)&&(Code==0xc4)))
  414.           {
  415.            code[n]=(UBYTE)Code;
  416.            code[0]=n;
  417.            n++;
  418.            ZeigeCode(rp,FALSE);
  419.            ignore=FALSE;
  420.           }
  421.         }
  422.        else
  423.         {
  424.          DisplayBeep(NULL);
  425.         }
  426.       break;
  427.      case GADGETUP:
  428.        if(gad->GadgetID==200) ignore=TRUE;
  429.      case GADGETDOWN:
  430.        if(gad->GadgetID==102) ende=TRUE;
  431.       break;
  432.     }
  433.   }
  434.  strcpy(k,&Kommentar);
  435.  RemoveGadget(win,&Kommentar_Gadget);
  436.  PrintK(win);
  437. }
  438.  
  439.  
  440. /* F-Tasten neu belegen */
  441. VOID FTastenAendern()
  442. {
  443.  REGISTER WORD                 i,w;
  444.  REGISTER ULONG                Class;
  445.  REGISTER UWORD                Code,id,MenuNum,ItemNum;
  446.  register struct Window       *win;
  447.  register struct RastPort     *rp;
  448.  register struct IntuiMessage *msg;
  449.  struct Gadget                *IAddress;
  450.  BOOL                          ende,quit,changed;
  451.  UBYTE                         tx[30];
  452.  UBYTE                         fk[6];
  453.  UBYTE                        *k;
  454.  struct FTasten               *FUndo;
  455.  struct FileHandler           *fh;
  456.  
  457.  ende=changed=FALSE;
  458.  Nummer=1;
  459.  Ctrl=0;
  460.  Shift=0;
  461.  FUndo=AllocMem(sizeof(struct FTasten),MEMF_CLEAR|MEMF_PUBLIC);
  462.  if(FUndo==NULL) return;
  463.  strcpy(&fk,"<F1>");
  464.  CopyMem(&KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten,
  465.          FUndo,sizeof(struct FTasten));
  466.  Aufnahme_Gadget.Flags=GADGHCOMP;
  467.  
  468.  win=CreateStdWindow("ATKeyboard - Funktionstasten belegen",
  469.                   75,35,460,123+BorderHeight(),
  470.                   GADGETDOWN|GADGETUP|CLOSEWINDOW|RAWKEY|MENUPICK,
  471.                   WINDOWDEPTH|WINDOWDRAG|WINDOWCLOSE|ACTIVATE|GIMMEZEROZERO);
  472.  if(win!=NULL)
  473.   {
  474.    rp=win->RPort;
  475.    SetFont(rp,GetOpalFont());
  476.    AddGadget(win,&Aufnahme_Gadget,-1L);
  477.    OnGadget(&Aufnahme_Gadget,win,NULL);
  478.    CreateBoolGadget(win,10,5,210,12,"Einstellungen okay",1000);
  479.    CreateBoolGadget(win,227,5,210,12,"Einstellungen verwerfen",2000);
  480.    Shift_Gadget=CreateMinGadget(win,10,20,90,12,100);
  481.    Ctrl_Gadget=CreateMinGadget(win,10,34,90,12,101);
  482.    DrawPTextBorder(win,10,20,90,12,"Shift");
  483.    DrawPTextBorder(win,10,34,90,12,"Control");
  484.    DrawPTextBorder(win,10,48,90,12,"Aufnahme");
  485.    for(i=0;i<10;i++)
  486.     {
  487.      w=110+(i*33);
  488.      sprintf(&tx,"F%ld",i+1);
  489.      CreateBoolGadget(win,w,20,30,12,&tx,i+1);
  490.     }
  491.    DrawNBorder(win,10,63,428,55);
  492.    PrintK(win);
  493.    DrawCNTextBorder(win,110,34,328,12,"<Amiga>+<F1>");
  494.    WriteText(rp,125,58,"Kommentar:");
  495.    ZeigeCode(rp,TRUE);
  496.    SetMenuStrip(win,&Datei_Menu);
  497.    while(ende==FALSE)
  498.     {
  499.      WaitPort(win->UserPort);
  500.      msg=GetMsg(win->UserPort);
  501.      Class=msg->Class;
  502.      Code=msg->Code;
  503.      IAddress=msg->IAddress;
  504.      ReplyMsg(msg);
  505.      switch(Class)
  506.       {
  507.        case CLOSEWINDOW:
  508.          if(changed==TRUE)
  509.           {
  510.            ende=UsePrefs();
  511.            if(ende==FALSE)
  512.             {
  513.              CopyMem(FUndo,
  514.                      &KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten,
  515.                      sizeof(struct FTasten));
  516.             }
  517.           }
  518.          ende=TRUE;
  519.         break;
  520.        case MENUPICK:
  521.           MenuNum=MENUNUM(Code);
  522.           ItemNum=ITEMNUM(Code);
  523.           switch(MenuNum)
  524.            {
  525.             case MENU_DATEI:
  526.               switch(ItemNum)
  527.                {
  528.                 case ITEM_LADEN:
  529.                   if(FileRequester!=NULL)
  530.                    {
  531.                     k=FileReq("FKey-Datei laden:","#?.fkey");
  532.                    }
  533.                   else
  534.                    {
  535.                     k=StringAbfrage(FALSE,"FKey-Datei laden:","");
  536.                    }
  537.                   if((strcmp(k,"")))
  538.                    {
  539.                     fh=Open(k,MODE_OLDFILE);
  540.                     if(fh!=NULL)
  541.                      {
  542.                       i=Read(fh,
  543.                              &KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten,
  544.                              sizeof(struct FTasten));
  545.                       if(i!=sizeof(struct FTasten))
  546.                        {
  547.                         Requester("FKey-Datei hat falsche","Länge/Falsches Format.","Okay",NULL);
  548.                         CopyMem(FUndo,
  549.                                 &KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten,
  550.                                 sizeof(struct FTasten));
  551.                        }
  552.                       else changed=TRUE;
  553.                       Close(fh);
  554.                      }
  555.                     else
  556.                      {
  557.                       Requester("Die FKey-Datei konnte","nicht geöffnet werden.","Okay",NULL);
  558.                      }
  559.                     PrintK(win);
  560.                     ZeigeCode(rp,TRUE);
  561.                    }
  562.                  break;
  563.                 case ITEM_SICHERN:
  564.                   if(FileRequester!=NULL)
  565.                    {
  566.                     k=FileReq("FKey-Datei sichern:","#?.fkey");
  567.                    }
  568.                   else
  569.                    {
  570.                     k=StringAbfrage(FALSE,"FKey-Datei sichern als:","");
  571.                    }
  572.                   if((strcmp(k,"")))
  573.                    {
  574.                     fh=Open(k,MODE_NEWFILE);
  575.                     if(fh!=NULL)
  576.                      {
  577.                       Write(fh,
  578.                             &KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten,
  579.                             sizeof(struct FTasten));
  580.                       Close(fh);
  581.                      }
  582.                     else
  583.                      {
  584.                       Requester("Die FKey-Datei konnte","nicht erstellt werden.","Okay",NULL);
  585.                      }
  586.                    }
  587.                  break;
  588.                 case ITEM_ENDE:
  589.                   ende=TRUE;
  590.                  break;
  591.                }
  592.              break;
  593.             case MENU_BEARBEITEN:
  594.               switch(ItemNum)
  595.                {
  596.                 case ITEM_UNDO:
  597.                   CopyMem(FUndo,
  598.                           &KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten,
  599.                           sizeof(struct FTasten));
  600.                   PrintK(win);
  601.                   ZeigeCode(rp,TRUE);
  602.                  break;
  603.                 case ITEM_KOMMENTAR:
  604.                   k=GetK();
  605.                   strcpy(&Kommentar,k);
  606.                   AddKGadget(win);
  607.                   ActivateGadget(&Kommentar_Gadget,win,NULL);
  608.                   quit=FALSE; changed=TRUE;
  609.                   while(quit==FALSE)
  610.                    {
  611.                     WaitPort(win->UserPort);
  612.                     msg=GetMsg(win->UserPort);
  613.                     if(msg->Class==GADGETUP) quit=TRUE;
  614.                     ReplyMsg(msg);
  615.                    }
  616.                   strcpy(k,&Kommentar);
  617.                   RemoveGadget(win,&Kommentar_Gadget);
  618.                   PrintK(win);
  619.                  break;
  620.                }
  621.              break;
  622.             case MENU_HILFE:
  623.               if(ItemNum==ITEM_HILFE) Help(HelpName,148);
  624.              break;
  625.            }
  626.          break;
  627.        case GADGETDOWN:
  628.          id=IAddress->GadgetID;
  629.          if(id==102)
  630.           {
  631.            changed=TRUE;
  632.            Aufnahme(win);
  633.           }
  634.          break;
  635.        case GADGETUP:
  636.          id=IAddress->GadgetID;
  637.          if(id<1000)
  638.           {
  639.            if((id>=0)&&(id<=10))
  640.             {  
  641.              Nummer=id;
  642.              sprintf(&fk,"<F%ld>",Nummer);
  643.             }
  644.            else if(id==100)
  645.             {
  646.              if(Shift==0)
  647.               {
  648.                Shift=1;
  649.                DrawNBorder(win,10,20,90,12);
  650.               }
  651.              else
  652.               {
  653.                Shift=0;
  654.                DrawPBorder(win,10,20,90,12);
  655.               }
  656.             }
  657.            else if(id==101)
  658.             {
  659.              if(Ctrl==0)
  660.               {
  661.                Ctrl=1;
  662.                DrawNBorder(win,10,34,90,12);
  663.                }
  664.              else
  665.               {
  666.                Ctrl=0;
  667.                DrawPBorder(win,10,34,90,12);
  668.               }
  669.             }
  670.  
  671.            strcpy(&tx,"<Amiga>+");
  672.            if(Shift==1) strcat(&tx,"<Shift>+");
  673.            if(Ctrl==1) strcat(&tx,"<Control>+");
  674.            strcat(&tx,&fk);
  675.            PrintK(win);
  676.            DrawCNTextBorder(win,110,34,328,12,&tx);
  677.            ZeigeCode(rp,TRUE);
  678.           }
  679.          else
  680.           {
  681.            if(id==1000)
  682.             {
  683.              ende=TRUE;
  684.             }
  685.            else if(id==2000)
  686.             {
  687.              CopyMem(FUndo,
  688.                      &KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten,
  689.                      sizeof(struct FTasten));
  690.              ende=TRUE;
  691.             }
  692.           }
  693.         break;
  694.       }
  695.     }
  696.    ClearMenuStrip(win);
  697.    DeleteStdWindow(win);
  698.   }
  699.  FreeMem(FUndo,sizeof(struct FTasten));
  700. }
  701.  
  702.  
  703. VOID AddKGadget(win)
  704.  struct Window *win;
  705. {
  706.  
  707.  SetAPen(win->RPort,0);
  708.  RectFill(win->RPort,225,47,445,61);
  709.  AddGadget(win,&Kommentar_Gadget,-1L);
  710.  RefreshGadgets(&Kommentar_Gadget,win,NULL);
  711.  DrawNBorder(win,226,49,211,10);
  712.  DrawPBorder(win,225,48,213,12);
  713. }
  714.  
  715.